<template>
	<view v-if="pageShow">
		<view class="" style="padding-bottom: 180rpx;">
			<u-swiper :list="dataAll.images_text" height="284" circular></u-swiper>
			<view class="" style="position: relative; top: -30rpx;">
				<!--  -->
				<view class="block  ffffff">
					<view class="sanshier zhonghei fonweight">{{dataAll.name}}</view>
					<view class="flexbetween margin_top2">
						<view class="flexleft ">
							<view class="ershil xiaohei">{{dataAll.bq}}</view>
						</view>
						<view class="flexright" @click="tzcksj">
							<view class="xiaohui strongtext">查看详细介绍</view>
							<u-icon name="arrow-right" color="#999999"></u-icon>
						</view>
					</view>
					<view class="flexbetween margin_top2">
						<view class="flexleft">
							<view class="dingwei margin_right2">
								<view class="sishi fonweight zhonghei dingwei" style="z-index: 1;">{{dataAll.star}}</view>
								<view class="ztxhx"></view>
							</view>
							<view class="xiaohui strongtext ">{{dataAll.comment_num}}评论</view>
						</view>
						<view class="flexright" @click="tzckpj">
							<view class="xiaohui strongtext ">查看全部评论</view>
							<u-icon name="arrow-right" color="#999999"></u-icon>
						</view>
					</view>
					<view class="flexbetween margin_top">
						<view class="">
							<view class="flexleft">
								<view class="margin_right1">
									<u-icon name="phone" color="#969696"></u-icon>
								</view>
								<view class="xiaohei ershil">{{dataAll.mobile}}</view>
							</view>
							<view class="flexleft margin_top">
								<view class="margin_right1">
									<u-icon name="map" color="#969696"></u-icon>
								</view>
								<view class="xiaohei ershil">{{dataAll.detail}}</view>
							</view>
						</view>
						<view class="flexright">
							<view class="margin_right4" @click="callphone(dataAll.mobile)">
								<image class="dhicon" src="../static/images/system/dh.png" mode=""></image>
								<view class="xiaocheng ershil margin_top1 textcenter">电话</view>
							</view>
							<view class="" @click="openmap">
								<image class="dhicon" src="../static/images/system/dh1.png" mode=""></image>
								<view class="xiaolan ershil margin_top1 textcenter">导航</view>
							</view>
						</view>
					</view>
				</view>
				<!--  -->
				<view class="ffffff mainpadding flexbetween margin_top" v-for="item in dataAll.hotel_type" :key="item.id" @click="tzfjxq(item.id)">
					<image class="tupian" :src="item.image_text" mode=""></image>
					<view class="" style="width: 68%;">
						<view class="zhonghei sanshier fonweight ">{{item.name}}</view>
						<view class="xiaohui ershil margin_top2 yhxk">
							<text v-for="(value,key,index) in item.attr_text" :key="key">{{key}}-{{value}}</text>
						</view>
						<view class="flexbottom1 margin_top">
							<view class="xiaocheng strongtext fonweight margin_right1">￥
								<text class="xiaocheng fonweight bigtext ">{{item.salesprice}}</text>
							</view>
							<image class="zaxd" src="../static/images/system/zxd.png" mode="" @click.stop="goYuDing(item.id)"></image>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid: "",
				dataAll: {},
				pageShow:false
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.getDetail()
		},
		methods: {
			getDetail() {
				httpRequest.request('/api/hotelcl/hotelDetail', 'GET', {
					id: this.listid
				}, false, false, true).then(res => {
					this.dataAll = res.data
					this.pageShow = true
				})
			},
			openmap(){
				uni.openLocation({
				     latitude: Number(this.dataAll.lat),//即将传到高德或腾讯地图的终点纬度  必须是数值，字符串无效
				     longitude:Number(this.dataAll.lng),//即将传到高德或腾讯地图的终点经度  必须是数值，字符串无效
				     name: this.dataAll.name,//即将传到高德或腾讯地图的店铺名称
				     address: this.dataAll.detail,//即将传到高德或腾讯地图的详细地址
				     scale: 18
				})
			},
			// 跳转商家介绍
			tzcksj(){
				uni.navigateTo({
					url:'/pages_index/shangjiajs?type=2&id='+this.listid
				})
			},
			// 跳转查看评价
			tzckpj(){
				uni.navigateTo({
					url: '/pages_index/pingjiajiudian?type=2&id='+this.listid
				})
			},
			// 跳转房间详情
			tzfjxq(id) {
				uni.navigateTo({
					url: '/pages_index/fangjianxq?id='+id
				})
			},
			goYuDing(id) {
				if (!httpRequest.checkIsLogin()) {
					uni.navigateTo({
						url: "/pages/login/login"
					})
					return false;
				}
				uni.navigateTo({
					url: '/pages_index/yudingjiudian?id=' + id
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.hhbtn {
		width: 89rpx;
		height: 37rpx;
		border-radius: 37rpx 37rpx 37rpx 37rpx;
		font-size: 24rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #999999;
		border: 2rpx solid #999999;
	}

	.shangj:first-child {
		margin-top: 0;
	}

	.shangj {
		margin-top: 30rpx;
	}

	.huabtn {
		width: 295rpx;
		height: 76rpx;
		border-radius: 120rpx;
		font-size: 32rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		color: #FFFFFF;
		background-color: #FF9341;
	}

	.zaxd {
		width: 87rpx;
		height: 86rpx;
	}

	.tupian {
		width: 199rpx;
		height: 228rpx;
		border-radius: 9rpx 9rpx 9rpx 9rpx;
	}

	.xhbtn {
		width: 72rpx;
		height: 34rpx;
		background: #E7E7E7;
		border-radius: 17rpx 17rpx 17rpx 17rpx;
		font-size: 22rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #333333;
	}

	.dhicon {
		width: 66.66rpx;
		height: 66.66rpx;
	}

	.ztxhx {
		position: absolute;
		bottom: 6rpx;
		left: 0;
		width: 56rpx;
		z-index: 0;
		height: 9rpx;
		background: #FF9341;
	}

	.block {
		padding: 30rpx 30rpx;
		border-radius: 39rpx 39rpx 0rpx 0rpx;
	}
</style>